<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>Buy Package</title>
</h:head>
<h:body>
<h:form>
    <p:menubar>  
    <p:menuitem value="Home" url="home.xhtml" /> 
        <p:submenu label="Package Section" >  
            <p:menuitem value="All Packages" url="package.xhtml" />  
        </p:submenu>  
  
        <p:submenu label="Gift List" >  
            <p:menuitem value="My Gift List" url="giftList.xhtml" />    
        </p:submenu>  
  
       <f:facet name="options">   
       		<p:commandButton value="Edit Profile" action="profileEdit.xhtml"/>
            <p:commandButton value="Logout" action="#{LoginManaged.logout()}" icon="ui-icon-close" />
       </f:facet>
    </p:menubar>  
</h:form>
	<h:form>
		<p:panelGrid columns="2">
			<f:facet name="header">Package</f:facet>
			<p:outputLabel value = "Name:"/>
			<h:outputText value="#{PackagePM.pack.name}"/>
			<p:outputLabel value = "Description:"/>
			<h:outputText value="#{PackagePM.pack.description}"/>
			<p:outputLabel value = "Nation:"/>
			<h:outputText value="#{PackagePM.pack.nation}"/>
			<p:outputLabel value = "Price:"/>
			<h:outputText value="#{PackagePM.pack.price}"/>
		</p:panelGrid>
			<p:growl id="hotel" showDetail="false" />  
			<p:fieldset legend="Hotel Info" toggleable="true" collapsed="true" toggleSpeed="500">  
        		<p:ajax event="toggle" update="hotel" />  
        		<p:panelGrid columns="2">
					<p:outputLabel value = "Name:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.name}"/>
					<p:outputLabel value = "Available Place:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.availablePlaces}"/>
					<p:outputLabel value = "Description:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.description}"/>
					<p:outputLabel value = "Website:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.website}"/>
					<p:outputLabel value = "EMail:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.email}"/>
					<p:outputLabel value = "City:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.city}"/>
					<p:outputLabel value = "Stars:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.stars}"/>
					<p:outputLabel value = "Address:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.address}"/>
					<p:outputLabel value = "Phone:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.phone}"/>
					<p:outputLabel value = "Price:"/>
					<h:outputText value="#{PackagePM.bDTO.hDTO.price}"/> 
				</p:panelGrid>
    		</p:fieldset>  
    		
    		<p:growl id="going" showDetail="false" />  
			<p:fieldset legend="Going Info" toggleable="true" collapsed="true" toggleSpeed="500">  
        		<p:ajax event="toggle" update="going" />  
        		<p:panelGrid columns="2">
					<h:outputLabel>Name</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.name}" />
					<h:outputLabel>Available Places</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.availablePlaces}" />
					<h:outputLabel>Type</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.type}" />
					<h:outputLabel>Arrival Time</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.arrivalTime}">
		    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
		    		</h:outputText>
					<h:outputLabel>Departure Time</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.departureTime}">
		    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
		    		</h:outputText>
					<h:outputLabel>Arrival Date</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.arrivalDate}">
		  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
					</h:outputText>
					<h:outputLabel>Departure Date</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.departureDate}">
		  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
					</h:outputText>
					<h:outputLabel>Arrival Place</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.arrivalPlace}" />
					<h:outputLabel>Departure Place</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.departurePlace}" />
					<h:outputLabel>Company</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.company}" />
					<h:outputLabel>Price</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.gDTO.price}" />
				</p:panelGrid>
    		</p:fieldset>  

			<p:growl id="return" showDetail="false" />  
			<p:fieldset legend="Return Info" toggleable="true" collapsed="true" toggleSpeed="500">  
        		<p:ajax event="toggle" update="return" />  
        		<p:panelGrid columns="2">
					<h:outputLabel>Name</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.name}" />
					<h:outputLabel>Available Places</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.availablePlaces}" />
					<h:outputLabel>Type</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.type}" />
					<h:outputLabel>Arrival Time</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.arrivalTime}">
		    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
		    		</h:outputText>
					<h:outputLabel>Departure Time</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.departureTime}">
		    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
		    		</h:outputText>
					<h:outputLabel>Arrival Date</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.arrivalDate}">
		  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
					</h:outputText>
					<h:outputLabel>Departure Date</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.departureDate}">
		  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
					</h:outputText>
					<h:outputLabel>Arrival Place</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.arrivalPlace}" />
					<h:outputLabel>Departure Place</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.departurePlace}" />
					<h:outputLabel>Company</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.company}" />
					<h:outputLabel>Price</h:outputLabel>
					<h:outputText value="#{PackagePM.bDTO.rDTO.price}" />
				</p:panelGrid>
    		</p:fieldset>  
    		
    		<p:growl id="excursion" showDetail="false" />  
			<p:fieldset legend="Excursion Info" toggleable="true" collapsed="true" toggleSpeed="500">  
        		<p:ajax event="toggle" update="excursion" />  
        		<p:panelGrid columns="2">
					<p:outputLabel value = "Name:"/>
					<h:outputText value="#{PackagePM.eDTO.name}"/>
					<p:outputLabel value = "Date:"/>
					<h:outputText value="#{PackagePM.eDTO.date}">
		  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
					</h:outputText>
					<p:outputLabel value = "Available Place:"/>
					<h:outputText value="#{PackagePM.eDTO.availablePlaces}"/>
					<p:outputLabel value = "Description:"/>
					<h:outputText value="#{PackagePM.eDTO.description}"/>
					<p:outputLabel value = "Duration:"/>
					<h:outputText value="#{PackagePM.eDTO.duration}"/>
					<p:outputLabel value = "Type:"/>
					<h:outputText value="#{PackagePM.eDTO.type}"/>
					<p:outputLabel value = "City:"/>
					<h:outputText value="#{PackagePM.eDTO.city}"/>
					<p:outputLabel value = "Price:"/>
					<h:outputText value="#{PackagePM.eDTO.price}"/>
				</p:panelGrid>
    		</p:fieldset>
    		<p:panelGrid columns="3">
			<p:commandButton value="Buy" action="#{PackagePM.purchase}" ajax="false"/>
			<p:commandButton value="Create Gift List" action="#{PackagePM.createGiftList}" ajax="false"/>
			<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> 
    </p:panelGrid>
    </h:form>
    
    <h:form>
    	 <p:accordionPanel>  
  
  		<p:tab title="Invite a friend" >  
            <p:panelGrid columns="2">
				<p:outputLabel value = "Join link :"/>
				<p:outputLabel id="email" value="#{PackagePM.link}" /> 
			</p:panelGrid>
        </p:tab>  
        </p:accordionPanel>
    </h:form>
    <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
</h:body>	

</html>